<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" charset="utf-8">
	function logout() {
		$('#sessionInfoDiv').html('');
		$.post('${pageContext.request.contextPath}/userAction!do_logout.action', function() {
			location.replace('${pageContext.request.contextPath}/');
		});
	};
	function userChangePwd() {
		var p = parent.sy.dialog({
			title : '修改用户密码',
			iconCls: 'icon-edit',
			href : '${pageContext.request.contextPath}/userAction!doNotNeedAuth_userChangePwd.action',
			width : 320,
			height : 250,
			buttons : [ {
				text : '保存',
				iconCls: 'icon-save',
				handler : function() {
					var f = p.find('form');
					f.form('submit', {
						url : '${pageContext.request.contextPath}/userAction!doNotNeedAuth_ChangePwd.action',
						onSubmit: function(){
							if (p.find('input[name="newpwd"]').val().length<6){
								parent.sy.messagerAlert('提示', '新密码不能少于6位！', 'info');
								p.find('input[name="newpwd"]').focus();
								return false;
							}else{
								if (p.find('input[name="newpwd"]').val()!=p.find('input[name="newpwd2"]').val()){
									parent.sy.messagerAlert('提示', '输入的新密码两次不一致，请重新 输入！', 'info');
									p.find('input[name="newpwd"]').focus();
									return false;
								}
							}
						},
						success : function(d) {
							var json = $.parseJSON(d);
							if (json.success) {
								p.dialog('close');
							}
							parent.sy.messagerShow({
								msg : json.msg,
								title : '提示'
							});
						}
					});
				}
			} ],
			onLoad : function() {
				f=p.find('form');
				f.form('load',{
					cid:'${sessionInfo.userId}',
					cname:'${sessionInfo.loginName}'
				});
			}
		});
	};
	$(function(){
		var cur_date=new Date();
		$('#index_date').html(cur_date.format('yyyy年MM月dd日')+'，');
	});
</script>
<img src="${pageContext.request.contextPath}/images/hf.png" />;
<div id="sessionInfoDiv" style="position: absolute;right: 5px;top:10px;overflow: hidden;">
	<span id="index_date"></span><c:if test="${sessionInfo.userId != null}"><strong>${sessionInfo.loginName}</strong>[${sessionInfo.deptName}]，欢迎您！您使用[<strong>${sessionInfo.ipAddress}</strong>]IP登录！</c:if>
</div>
<div style="position: absolute; right: 10px; bottom: 10px; ">
	<img src="${pageContext.request.contextPath}/css/themes/icons/key.png" style="display:inline-block;vertical-align:middle;width:16px;height:16px;"/>&nbsp;<a href="javascript:void(0);"  onclick="userChangePwd();" style="vertical-align:middle;text-decoration:none;">修改密码</a>&nbsp;&nbsp;&nbsp;&nbsp;<img src="${pageContext.request.contextPath}/css/themes/icons/exit.png" style="display:inline-block;vertical-align:middle;width:16px;height:16px;"/>&nbsp;<a href="javascript:void(0);"  onclick="logout();" style="vertical-align:middle;text-decoration:none;">退出系统</a>
</div>

